<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加书籍</title>
    <link rel="stylesheet" href="static/css/bootstrap.css">
    <link rel="stylesheet" href="static/css/bootstrap-table.css">

    <script src="static/js/jquery-3.3.1.min.js"></script>
    <script src="static/js/bootstrap.js"></script>
    <script src="static/js/bootstrap-table.js"></script>
    <script src="static/js/bootstrap-table-zh-CN.js"></script>
</head>

<body>
<div style="height: 50px"></div>

<div class="col-md-4"></div>
<div class="col-md-4">
    <h3>添加图书</h3>
    <hr>
    <form action="/add" method="post" enctype="multipart/form-data">
        <label>书名</label><br>
        <input name="name" class="form-control"><br>
        <br>
        <label>作者</label><br>
        <input name="author" class="form-control"><br>
        <br>
        <label>价格</label><br>
        <input name="price" class="form-control"><br>
        <br>
        <label>出版日期</label><br>
        <input type="date" name="time"><br>
        <br>
        <label>主图</label><br>
        <input type="file" name="priImgFile"><br>
        <br>
        <label>副图</label><br>
        <input type="file" name="subImgFiles"><br>
        <input type="file" name="subImgFiles"><br>
        <br>
        <table id="b"></table>
        <input type="button" id="a" value="再传一张">
        <div class="modal-footer">
            <button class="btn btn-primary btn-default">确认</button>
        </div>
    </form>
</div>
<div class="col-md-4"></div>
</body>
<script>
    $(function () {
        $('#a').click(function () { //点击事件添加再传一张
            $('#b').append(
                $('<tr>').append(
                    $('<td>').append(
                        $('<p>').html('<div><input type="file" name="subImgFiles">')
                    )
                )
            )
        })
    })

</script>
</html>